package com.redwood.report.activity.bak;


import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.redwood.report.R;
import com.redwood.report.util.ImageLoaderUtil;
import com.redwood.report.util.actionbar.LightStatusBarUtils;
import com.redwood.report.util.actionbar.ToolbarUtil;
import butterknife.BindView;
import butterknife.ButterKnife;
import uk.co.senab.photoview.PhotoView;
import uk.co.senab.photoview.PhotoViewAttacher;

public class PicturePreviewActivity extends AppCompatActivity {

    @BindView(R.id.preview_image)
    PhotoView previewImage;
//    @BindView(R.id.iv_back)
//    ImageView ivBack;
    public Activity getActivity(){
        return this;
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //标题栏颜色
        ToolbarUtil.setColorNoTranslucent(this, getResources().getColor(R.color.black));
        //深色主题 true字颜色为深色 false 为白色标题字
        LightStatusBarUtils.setLightStatusBar(this, true);
        setContentView(R.layout.activity_picture_preview);
        ButterKnife.bind(this);
        ImageLoaderUtil.loadImage480(getActivity(),getIntent().getStringExtra("url"),previewImage);
        previewImage.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
            @Override
            public void onViewTap(View view, float x, float y) {
                finish();
                overridePendingTransition(0, R.anim.a3);
            }
        });
    }
}
